SourceId::new(Kind::Registry, url.clone())
}
- /// Create a SourceId from an alternative registry url
- pub fn for_alt_registry(url: &Url) -> CargoResult<SourceId> {
- SourceId::new(Kind::AltRegistry, url.clone())
- }
-
/// Create a SourceId from a local registry path
pub fn for_local_registry(path: &Path) -> CargoResult<SourceId> {
let url = path.to_url()?;
} = registry_configuration(config, registry.clone())?;
let token = token.or(token_config);
let sid = match (index_config, index, registry) {
- (Some(index), _, Some(_registry)) => SourceId::for_alt_registry(&index.to_url()?)?,
+ (_, _, Some(registry)) => SourceId::alt_registry(config, ®istry)?,
(Some(index), _, _) | (None, Some(index), _) => SourceId::for_registry(&index.to_url()?)?,
(None, None, _) => SourceId::crates_io(config)?,
};